package com.lucy.common.config;

import cn.hutool.http.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.io.File;

@Slf4j
@Component
public class DocConfig {
    @Bean
    public void InitDoc(){
        String rootPath = System.getProperty("user.dir");
        log.debug("初始化Doc");
        HttpUtil.createServer(8888)
                // 设置默认根目录
                .setRoot(rootPath+ File.separator+".docs")
                .start();
    }
}
